// 注册 Handlebars Helper 函数
Handlebars.registerHelper("分割线", function () {
  return new Handlebars.SafeString(
    `<p style="width:100%;height: 1px;background: rgba(28, 34, 45, 0.06);"></p>`
  );
});

Handlebars.registerHelper("标题", function (options) {
  const Title = options.data.root.Title; // 固定参数名称
  const Welcome = options.data.root.Welcome; // 固定参数名称
  const Community = options.data.root.Community; // 固定参数名称
  return new Handlebars.SafeString(
    // `<p style="font-size: 16px;font-family: PingFangSC-Regular, PingFang SC;font-weight: 500;color: #000;line-height: 20px;margin:20px 0 10px 0;">${Title}</p>`
    `<p style="font-size: 18px; font-weight: 600;">${Title}</p><p style="font-size: 14px;color:rgba(28, 34, 45, 1);margin:0px 0 36px 0 ;text-align: left;">
    ${Welcome}
      <a href="" target="_blank"> xxx  ${Community}</a>
  </p>`
  );
});

Handlebars.registerHelper("描述", function (content) {
  return new Handlebars.SafeString(
    `<p style="font-size: 14px;color:rgba(28, 34, 45, 1);margin:0px 0 25px 0 ;text-align: left;"">${content}</p>`
  );
});

Handlebars.registerHelper("验证码", function () {
  return new Handlebars.SafeString(
    `<p style="display:flex;flex-flow:row nowrap;list-style:none;">{{Captcha}}</p>`
  );
});

Handlebars.registerHelper("客服服务", function (options) {
  const Service = options.data.root.Service; // 固定参数名称
  return new Handlebars.SafeString(
    `<p style="font-size: 14px;font-family: PingFangSC-Regular, PingFang SC;font-weight: 500;color: rgba(28, 34, 45, 0.65);line-height: 20px;margin:24px 0 24px 0;">
        ${Service}
    </p>`
  );
});

Handlebars.registerHelper("钓鱼码", function (options) {
  const FishingCode = options.data.root.FishingCode; // 固定参数名称
  const FishingCodeTip = options.data.root.FishingCodeTip; // 固定参数名称
  return new Handlebars.SafeString(
    `<p style="font-size: 14px;width: max-content;font-weight: 400;color: #333333;line-height: 20px;margin:85px 0 10px 0;border: 1px solid #000;">
            <span style="display: inline-block; background-color: #000; color: #FFFFFF;padding: 3px 5px;">${FishingCode}</span>
            <span style="display: inline-block;padding: 0 10px;">{{Hpishing}}</span>
        </p>
        <p style="font-size: 14px;color:rgba(28, 34, 45, 1);margin:0px 0 36px 0 ;text-align: left;">${FishingCodeTip}</p>
        <p style="width:100%;height: 1px;background: rgba(28, 34, 45, 0.06);"></p>
        `
  );
});
